package com.itheima.demo;

import java.math.BigDecimal;
@SuppressWarnings("all")
public class Demo_BigDecimal {

    public static void main(String[] args) {
        BigDecimal bd1 = new BigDecimal("1.0");
        BigDecimal bd2 = new BigDecimal("0.3");
        //BigDecimal divide = bd1.divide(bd2, 3, 4);
        // 四舍五入;
        //BigDecimal divide = bd1.divide(bd2,3,2);
        // 去尾法;
        BigDecimal divide = bd1.divide(bd2, 2, 1);
        //进一法;
        System.out.println(divide);

    }

}
